<template>

	<view class="page-content">

		<view class="top-content">
			<view class="avatar-nick-name">
				<view class="member-avatar">
					<u-image height="80rpx" width="80rpx" :src="getAvatar()" shape="circle"></u-image>
				</view>
				<view class="nick-name-mobile">
					<view v-show="isLogin()">
						<view class="member-nick-name">
							{{workerInfo.nickname}}
							<u-tag class="user-certification"
								:type="getCertificationStatus(workerInfo.authenticationStatus)"
								:text="getCertification(workerInfo.authenticationStatus)" mode="light" />
						</view>
						<view class="member-mobile">{{workerInfo.telephone}}</view>
					</view>
					<view class="login" v-show="!isLogin()">
						<view class="login-t" @click="loginPage('/pages/worker/login')">登录 / 注册</view>
						<view class="login-b" @click="loginPage('/pages/worker/login')">点击登录 享受更多精彩内容</view>
					</view>
				</view>
				<view class="setting" @click="gotoPage('/pages/worker/setting')" v-show="isLogin()">
					<u-icon name="setting" size="48"></u-icon>
				</view>
			</view>
			<view class="block-chain-addr" v-show="isLogin()"><text class="block-chain-addr-l"></text>
				<u-image height="32rpx" width="32rpx" src="/static/img/copy_my.png" v-show="workerInfo.blockChainAddr"
					@click="copyData(workerInfo.blockChainAddr)"></u-image>
			</view>
		</view>
		<!-- 登陆注册end -->
		<view>
			<view class="custom-tabs">
				<u-tabs :list="tabs" :is-scroll="false" :current="currentTab" @change="switchTab"
					class="tabs-custom"></u-tabs>
			</view>
			<view>
				<view class="no-data" v-show="noDataFlag">
					<u-empty text="暂无数据" mode="favor"></u-empty>
				</view>
				<view>
					<view class="order-record" v-for="orderRecord in orderRecords"
						@click="payOrderDetailPage(orderRecord.id)">
						<view class="order-record-content">
							<view class="order-record-content-top">
								<view class="order-record-content-top-l">
									订单编号：{{orderRecord.orderNum}}
								</view>
								<view class="order-status">{{getStatusText(orderRecord.status)}}</view>
								<view class="order-record-content-top-r">
									<view class="payment-state">
										<u-icon v-show="orderRecord.status === 'ALL'" name="clock-fill"
											size="26"></u-icon>
										<text v-show="orderRecord.status === '10'" class="payment-state-txt">已接单</text>
										<text v-show="orderRecord.status === '20'" class="payment-state-txt">已抢单</text>
										<text v-show="orderRecord.status === '30'" class="payment-state-txt">已拒绝</text>
										<text v-show="orderRecord.status === '40'" class="payment-state-txt">已完结</text>
										<text v-show="orderRecord.status === '50'" class="payment-state-txt">已取消</text>
									</view>
								</view>
							</view>
							<view class="order-record-content-middle">
								<view class="order-record-content-middle-l">
									<view class="service-name">
										{{ orderRecord.serviceCategoryName }}
									</view>
								</view>
								<view class="order-record-content-middle-r">
									<view class="collection-name">
										<view class="collection-name-l">
											上门时间：{{formatDateTime(orderRecord.reserveTime)}}
										</view>
									</view>
									<view>
										<view class="collection-name-2">
											服务地址：{{orderRecord.orderAddress}}
										</view>
									</view>
								</view>
							</view>
							<!-- 联系人弹窗start -->
							<view v-model="popupVisible" mode="center" safe-area-inset-bottom
								:mask-custom-style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }">
								<!-- 弹窗 -->
								<u-popup v-model="popupVisible" mode="center" safe-area-inset-bottom>
									<view class="popup-overlay"> <!-- 透明背景 -->
										<view class="popup-content">
											<view class="popup-header">
												<text>拨打预约人电话</text><br>
												<text class="phone-number">{{orderInfo.userTelephone}}</text>
											</view>

											<!-- 订单信息 -->
											<view class="order-info">
												<view class="order-item">
													<text>订单编号：</text>
													<text>{{ orderInfo.orderNum }}</text>
												</view>
												<view class="order-item">
													<text>预约服务：</text>
													<text>{{ orderInfo.serviceCategoryName }}</text>
												</view>
												<view class="order-item">
													<text>预约时间：</text>
													<text>{{formatDateTime(orderInfo.createTime)}}</text>
												</view>
												<view class="order-item">
													<text>服务地址：</text>
													<text>{{ orderInfo.orderAddress }}</text>
												</view>
											</view>

											<!-- 按钮 -->
											<view class="popup-buttons">
												<button @click="closePopup" class="btn-cancel">取消</button>
												<button @click="confirmPopup" class="btn-confirm">确认</button>
											</view>
										</view>
									</view>
								</u-popup>
							</view>
							<!--联系人弹窗end-->
							<!-- 施工上传弹窗start-->
							<view v-model="popupVisible1" mode="center" safe-area-inset-bottom
								:mask-custom-style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }">
								<u-popup v-model="popupVisible1" mode="center" safe-area-inset-bottom>
								  <view class="popup-overlay">
								    <view class="popup-content">
								      <!-- 关闭按钮 -->
								      <view class="close-btn" @click="popupVisible1 = false">×</view>
								      
								      <!-- 预约服务信息 -->
								      <view class="service-info">
								        <view class="service-item">
								          <text>预约服务：</text>
								          <text>{{ orderInfo.serviceCategoryName }}</text>
								        </view>
								        <view class="service-item">
								          <text>预约时间：</text>
								          <text>{{ formatDateTime(orderInfo.reserveTime) }}</text>
								        </view>
								        <view class="service-item">
								          <text>服务地址：</text>
								          <text>{{ orderInfo.orderAddress }}</text>
								        </view>
								        <view class="service-item">
								          <text>备注信息：</text>
								          <text>{{ orderInfo.notes }}</text>
								        </view>
								      </view>
								
								      <!-- 施工前上传图片 -->
								      <view class="upload-section">
								        <text v-if="!orderInfo.workPreTime">施工前：</text>
								        <text v-else>施工后：</text>
								        
								        <!-- 施工前图片 -->
								        <image v-if="!orderInfo.workPreTime && beforeImageUrl" :src="beforeImageUrl" class="upload-image"></image>
								        <view v-else-if="!orderInfo.workPreTime && !beforeImageUrl" class="upload-placeholder" @click="uploadImage('before')">
								          <text>上传施工前图片</text>
								        </view>
								        
								        <!-- 施工后图片 -->
								        <image v-if="orderInfo.workPreTime && afterImageUrl" :src="afterImageUrl" class="upload-image"></image>
								        <view v-else-if="orderInfo.workPreTime && !afterImageUrl" class="upload-placeholder" @click="uploadImage('after')">
								          <text>上传施工后图片</text>
								        </view>
								
								        <!-- 金额输入框 -->
								        <input 
								          v-if="orderInfo.workPreTime" 
								          v-model="amount" 
								          placeholder="请输入金额" 
								          type="number" 
								          @input="validateAmount"
								        />
								      </view>
		
								      <button class="submit-btn" @click="handleSubmit">提交</button>
								    </view>
								  </view>
								</u-popup>
							</view>
							<!-- 施工上传弹窗end-->
							<view class="order-record-content-bottom">
							  <view class="order-record-time">
							    {{ formatDateTime(orderRecord.createTime) }}
							  </view>
							
							  <!-- 当状态不是 CANCELED, REJECTED, COMPLETED 时显示按钮 -->
							  <u-button
							    v-if="!['CANCELED', 'REJECTED', 'COMPLETED','RATED'].includes(String(orderRecord.status))"
							    class="custom-order-modal-btn custom-order-modal-btn-success" 
							    type="success"
							    @click="showPopup(orderRecord)"
							  >
							    联系预约人
							  </u-button>
							
							  <u-button
							    v-if="!['CANCELED', 'REJECTED', 'COMPLETED','AWAITING_PAYMENT','RATED'].includes(String(orderRecord.status))"
							    class="custom-order-modal-btn custom-order-modal-btn-cancel" 
							    type="primary"
							    @click="showPopup1(orderRecord)"
							  >
							    {{ orderRecord.workPreTime ? '施工后' : '施工前' }}
							  </u-button>
							</view>


						</view>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import QRCode from 'qrcodejs2';
	// import OSS from 'ali-oss-sdk';

	export default {
		data() {
			return {
				beforeImage: '', // 施工前图片
				afterImage: '', // 施工后图片
				isBefore: true, // 当前选择的是施工前还是施工后
				imageUrl: '', // 上传的图片URL
				popupVisible: false, // 控制弹窗的显示与隐藏
				popupVisible1: false, // 控制弹窗的显示与隐藏
				beforeImage: '', // 施工前图片文件路径或 File 对象
				beforeImageUrl:'' , // 施工前图片的预览 URL
				afterImage: '', // 施工后图片文件路径或 File 对象
				afterImageUrl: '', // 施工后图片的预览 URL
				workerInfo: '',
				customerServiceUrl: '',
				amount: 0, // 金额

				tabs: [{
					name: '全部',
					value: 'ALL',
				}, {
					name: '已接单',
					value: '10'
				}, {
					name: '已抢单',
					value: '20'
				}, {
					name: '已拒绝',
					value: '30'
				}, {
					name: '已完结',
					value: '40',
				}, {
					name: '已取消',
					value: '50',
				}],
				currentTab: 0,
				pageNum: 1,
				loadingState: 'loadmore',
				pullDownRefreshFlag: false,
				noDataFlag: false,
				orderRecords: [],
				showPayModalFlag: false,
				showCancelModalFlag: false,
				selectedOrder: '',
				tokenId: '',
				showPayQRCode: false,
				payQRCodeURL: '',
				checkToken: '',
				payOrderId: '',
				orderInfo: '',
				Token: '',


				beforeImage: '', // 施工前图片的本地路径
				afterImage: '', // 施工后图片的本地路径
			}
		},
		onLoad(option) {
			if (!this.isLogin()) {
				this.loginPage();
				return;
			}

			// this.findByPage();
			this.getToken();
		},
		onShow() {
			this.getMyworkerInfo();
			this.findByPage();
		},
		onPullDownRefresh() {
			this.pullDownRefreshFlag = true;
			this.refreshData();
		},
		onReachBottom() {
			this.nextPage();
		},
		methods: {
			
			 // 验证金额是否为负数
			  validateAmount() {
			    if (this.amount < 0) {
			      this.amount = 0;  // 设置为0，防止负数
			      uni.showToast({
			        title: '金额不能为负数',
			        icon: 'none'
			      });
			    }
			  },
			  
			  // 提交处理逻辑
			  handleSubmit() {
			    if (this.amount <= 0) {
			      uni.showToast({
			        title: '请输入有效金额',
			        icon: 'none'
			      });
			      return;
			    }
			  },
			//施工上传
			showPopup1(orderRecord) {
				this.popupVisible1 = true; // 显示弹窗
				this.$u.get(`/order/worker/getOrderInfo/${orderRecord.orderNum}`).then(res => {
					if (res.data.length == 0) {
						this.noDataFlag = true;
						return;
					}
					// 处理获取到的订单信息
					this.orderInfo = res.data; // 假设你想将数据存储在 orderInfo 中
				})
			},
			closePopup1() {
				this.popupVisible1 = false; // 关闭弹窗
			},
			confirmPopup1() {
				this.popupVisible1 = false; // 确认操作后关闭弹窗
				// 此处可以添加确认后的处理逻辑
			},

			uploadImage(type) {
				uni.chooseImage({
					count: 1,
					success: (chooseImageRes) => {
						const tempFilePath = chooseImageRes.tempFilePaths[0];
						uni.uploadFile({
							url: 'http://121.40.22.146:8888/worker/upload', // 请确保此URL是正确的
							filePath: tempFilePath,
							name: 'file', // 'file' 为后端接收文件的字段名
							success: (uploadFileRes) => {
								const fileUrl = JSON.parse(uploadFileRes.data)
								.fileUrl; // 根据后台返回的格式获取文件URL
								if (type === 'before') {
									this.beforeImageUrl = fileUrl;
								} else {
									this.afterImageUrl = fileUrl;
								}
							},
							fail: (error) => {
							}
						});
					}
				});
			},
			// 提交处理方法
			handleSubmit() {
				//调用提交前图片的方法
				if(this.orderInfo.workPreTime==null){
					this.submitWorkBefore(this.beforeImageUrl);
				}else if(this.orderInfo.workPreTime!=null){
					this.submitWorkAfter(this.afterImageUrl,this.amount);
				}
				this.popupVisible1 = false; // 关闭弹窗
			},

			// 提交施工前图片地址的方法
			submitWorkBefore(beforeImageUrl) {
				this.$u.post(`http://121.40.22.146:8888/order/worker/submitWorkBefore?orderNum=${this.orderInfo.orderNum}&workBeforePhotoUrl=${beforeImageUrl}`, { 
				}).then(res => {
				  uni.showToast({
				    title: '施工前提交成功',
				    icon: 'success'
				  });
				  this.findByPage()
				}).catch(err => {
				  uni.showToast({
				    title: '施工前提交失败',
				    icon: 'none'
				  });
				});
			},
			submitWorkAfter(afterImageUrl, amount) {
				   this.$u.post(`http://121.40.22.146:8888/order/worker/submitWorkAfter?orderNum=${this.orderInfo.orderNum}&workAfterPhotoUrl=${afterImageUrl}&orderPrice=${amount}`, {
				   }).then(res => {
				     uni.showToast({
				       title: '施工前提交成功',
				       icon: 'success'
				     });
					 this.findByPage()
				   }).catch(err => {
				     uni.showToast({
				       title: '施工前提交失败',
				       icon: 'none'
				     });
				});
			},

			//施工上传结束
			showPopup(orderRecord) {
				this.popupVisible = true; // 显示弹窗
				this.$u.get(`/order/worker/getOrderInfo/${orderRecord.orderNum}`).then(res => {
					if (res.data.length == 0) {
						this.noDataFlag = true;
						return;
					}
					// 处理获取到的订单信息
					this.orderInfo = res.data; // 假设你想将数据存储在 orderInfo 中
				})
			},
			closePopup() {
				this.popupVisible = false; // 关闭弹窗
			},
			confirmPopup() {
				this.popupVisible = false; // 确认操作后关闭弹窗
				// 此处可以添加确认后的处理逻辑
			},
			getStatusText(status) {
				if (status === 'ACCEPTED') {
					return '已接单';
				} else if (status === 'REJECTED') {
					return '已拒绝';
				} else if (status === 'COMPLETED') {
					return '已完结';
				} else if (status === 'CANCELED') {
					return '已取消';
				}else if (status === 'AWAITING_PAYMENT') {
					return '待支付';
				} else if (status === 'IN_SERVICE') {
					return '维修中';
				}else if (status === 'RATED') {
					return '已评价';
				} else {
					return '已抢单';
				}

			},
			// 时间格式化方法
			formatDateTime(isoString) {
				const date = new Date(isoString);

				const year = date.getFullYear();
				const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始，所以要加1
				const day = date.getDate().toString().padStart(2, '0');
				const hours = date.getHours().toString().padStart(2, '0'); // 小时部分

				return `${year}年${month}月${day}日 ${hours}点`;
			},

			gotoPage(path) {
				uni.navigateTo({
					url: path
				});
			},
			loginPage(path) {
				// 使用 uni.navigateTo 跳转到师傅登录页面
				uni.navigateTo({
					url: path // 根据你实际的路径调整
				});
			},
			getToken() {
				this.$u.get('/auth/getToken', {
					scene: 'orderList'
				}).then(res => {
					if (res.data) {
						this.checkToken = res.data;
					}
				})
			},
			confirmPay() {
				this.$u.post('/trade/pay', {
					orderId: this.selectedOrder.orderId,
					payChannel: 'WECHAT',
					token: this.token
				}).then(res => {
					if (res.success) {
						this.showPayModalFlag = false;
						this.showPayQRCode = true;
						const payQRCodeURL = res.data.payUrl;
						this.payOrderId = res.data.payOrderId;

						setTimeout(() => {
							new QRCode(this.$refs.qrcodeImg, {
								text: payQRCodeURL,
								width: 170,
								height: 170
							})
						}, 300)

						return;
					}

					uni.showToast({
						icon: 'error',
						title: res.message,
						duration: 2000
					});
				});
			},
			payFinish() {
				this.$u.get('/order/getPayStatus', {
					payOrderId: this.payOrderId,
				}).then(res => {
					if (res.data.state !== 'FINISH' && res.data.state !== 'PAID') {
						uni.showToast({
							icon: 'error',
							title: '未完成支付',
							duration: 2000,
							mask: true,
							complete: () => {

							}
						});

						return;
					}

					this.showPayQRCode = false;
					uni.showToast({
						icon: 'success',
						title: '支付成功!',
						duration: 2000,
						mask: true,
						complete: () => {
							this.refreshData();
						}
					});


				});
			},
			cancelPay() {
				this.$u.post('/trade/cancel', {
					orderId: this.selectedOrder.orderId,
					token: this.checkToken
				}).then(res => {
					if (res.success) {
						uni.showToast({
							icon: 'success',
							title: '取消成功!',
							duration: 2000,
							mask: true,
							complete: function() {
								this.refreshData();
							}
						});

						return;
					}

					uni.showToast({
						icon: 'error',
						title: '取消失败',
						duration: 2000
					});
				});
			},
			showCancelModal(order) {
				this.selectedOrder = order;
				this.showCancelModalFlag = true;
			},

			showPayModal(order) {
				this.selectedOrder = order;
				this.showPayModalFlag = true;
			},

			moneyFormat(money, len) {
				len = len || 2
				if (!money && money !== 0)
					return ''
				if (isNaN(+money))
					return ''
				if (money === 0 || money === '0')
					return '0.' + '0'.repeat(len)
				const arr = (money + '').split('.')
				const intStr = arr[0] ? arr[0] : 0
				let floatStr = arr[1] ? arr[1] : 0
				if (floatStr === 0) {
					floatStr = '0'.repeat(len)
				} else {
					floatStr = (+('0.' + floatStr)).toFixed(len).split('.')[1]
				}
				money = (intStr + '.' + floatStr).replace(/(\d{1,3})(?=(?:\d{3})+\.)/g, `$1,`);
				return money
			},

			payOrderDetailPage(id) {
				uni.navigateTo({
					url: '/pages/orderDetail?id=' + id
				});
			},

			switchTab(index) {
				this.currentTab = index;
				this.refreshData();
			},

			refreshData() {
				this.pageNum = 1;
				this.loadingState = 'loading';
				this.findByPage();
			},

			nextPage() {
				if (this.loadingState == 'nomore') {
					return;
				}
				this.pageNum = this.pageNum + 1;
				this.findByPage();
			},

			findByPage() {
				if (this.pageNum == 1) {
					this.orderRecords = [];
				}
				const queryParam = {
					pageSize: 10,
					currentPage: this.pageNum,
				};

				const cv = this.tabs[this.currentTab].value;
				if (cv) {
					queryParam.status = cv
				}
				this.loadingState = 'loading';
				this.$u.get('/order/worker/getOrders', queryParam).then(res => {
					console.log(res)
					if (res.data.length == 0) {
						this.noDataFlag = true;
						
					}else if(res.code==500){
						uni.showToast({
						  title: res.msg,
						  icon: 'none'
						});
					}

					this.noDataFlag = false;
					this.orderRecords = this.orderRecords.concat(res.data);

					if (this.pullDownRefreshFlag) {
						this.pullDownRefreshFlag = false;
						uni.stopPullDownRefresh();
					}

					if (this.orderRecords.length == res.total) {
						this.loadingState = 'nomore';
					}
				});
			},

			loginPage() {
				uni.reLaunch({
					url: "/pages/worker/login"
				});
			},

			isLogin() {
				const tokenValue = uni.getStorageSync('tokenValue');
				return tokenValue != null && tokenValue != '';
			},
			getBlockChainAddr() {
				if (this.workerInfo) {
					if (!this.workerInfo.certification) {
						return '实名认证后生成区块链地址...';
					} else {
						return this.workerInfo.blockChainUrl ? this.workerInfo.blockChainUrl : '等待创建区块链地址...';
					}
				}
			},

			getAvatar() {
				return this.workerInfo.profilePhotoUrl ? this.workerInfo.profilePhotoUrl : '/static/img/avatar.png';
			},

			getMyworkerInfo() {
				if (!this.isLogin()) {
					return;
				}

				this.$u.get('/worker/getWorkerInfo').then(res => {
					this.workerInfo = res.data;
				});
			},

			getCertification(s) {
				return s === 1 ? '已实名' : s === 0 ? '未实名' : '待认证';
			},
			getCertificationStatus(s) {
				return s === 1 ? 'success' : s === 0 ? 'warning' : 'info';
			}
		}
	}
</script>

<style>
	page {
		height: 100% !important;
	}

	.msg-unread-num {
		background-color: #d10e0e;
	}

	.setting {
		color: white;
		padding-right: 32rpx;
		position: relative;
		top: -40rpx;
	}

	.user-certification {
		margin-left: 12rpx;
		vertical-align: middle;
	}

	.msg-read {
		height: 24rpx;
		width: 24rpx;
		border-radius: 24rpx;
		line-height: 24rpx;
		text-align: center;
		font-size: 20rpx;
		transform: scale(0.8);
		position: absolute;
		top: 0rpx;
		left: 46rpx;
	}

	.div-line {
		width: 100%;
		height: 20rpx;
		background: #f0f0f0;
	}

	.resale-price {
		padding-left: 16rpx;
	}

	.custom-tabs {
		padding-bottom: 32rpx;
		align-items: center;
	}

	.custom-tabs-l {
		flex: 1;
	}

	/* 选中的 tab 样式 */
	.tabs-custom>>>.u-tabs__item--active {
		background-color: #2979ff;
		/* 选中的 tab 背景颜色 */
		color: #ffffff;
		/* 选中的 tab 文字颜色 */
		border-radius: 10rpx;
		/* 可选：给选中的 tab 圆角 */
	}

	/* 未选中的 tab 样式 */
	.tabs-custom>>>.u-tabs__item {
		background-color: #e0e0e0;
		/* 未选中的 tab 背景颜色 */
		color: #333333;
		/* 未选中的 tab 文字颜色 */
		border-radius: 10rpx;
		/* 可选：给未选中的 tab 圆角 */
		padding: 10rpx 0;
		/* 可选：上下 padding 调整 */
		margin: 5rpx;
		/* 可选：增加 tabs 间距 */
	}

	.compose-activity {
		background: linear-gradient(to right, #2979ff, #909399);
		height: 56rpx;
		line-height: 56rpx;
		border-radius: 44rpx 0rpx 0rpx 44rpx;
		font-size: small;
		color: white;
		padding-left: 24rpx;
		padding-right: 24rpx;
		margin-left: 12rpx;
	}


	.custom-tab-content {
		padding-left: 32rpx;
		padding-right: 32rpx;
	}

	.collections {}

	.collection {
		padding-bottom: 10rpx;
	}

	.collection-content {
		background: #e7e7e7;
		border-radius: 20rpx;
		padding-bottom: 20rpx;
	}

	.collection-cover {
		border-radius: 20rpx 20rpx 0rpx 0rpx;
	}

	.collection-name {
		font-size: 26rpx;
		padding-left: 16rpx;
		padding-top: 16rpx;
		color: #000000;
	}

	.collection-hold-date {
		font-size: 24rpx;
		padding-left: 16rpx;
	}

	.no-data {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 400rpx;
	}

	.grid-navs {
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.grid-nav {
		color: white;
		text-align: center;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		position: relative;
	}

	.page-content {
		padding-bottom: 140rpx;

	}
.close-btn {
  position: absolute;
  top: 177px;
  right: 40px;
  font-size: 24px;       /* 按钮大小 */
  color: #666;           /* 按钮颜色 */
  cursor: pointer;       /* 鼠标悬停时显示为指针 */
  background-color: #fff; /* 按钮背景色 */
  border-radius: 50%;    /* 圆形按钮 */
  width: 30px;           /* 按钮宽度 */
  height: 30px;          /* 按钮高度 */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 阴影效果 */
}
.close-btn:hover {
  background-color: #f2f2f2; /* 悬停时背景色变化 */
}

	.top-content {
		padding-top: 64rpx;
		background: linear-gradient(to right, #2f2f2f, #747171);
	}

	.avatar-nick-name {
		display: flex;
		align-items: center;
		padding-bottom: 16rpx;
		padding-left: 32rpx;
	}

	.nick-name-mobile {
		flex: 1;
	}

	.login {}

	.login-t {
		padding-bottom: 12rpx;
		color: white;
	}

	.login-b {
		color: #888;
		font-size: smaller;
	}

	.member-avatar {
		padding-right: 20rpx;
	}

	.member-nick-name {
		font-size: larger;
		padding-bottom: 12rpx;
		color: white;
	}

	.member-mobile {
		font-size: small;
		color: #888;
	}

	.block-chain-addr {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-left: 32rpx;
		padding-right: 32rpx;
		padding-bottom: 16rpx;
	}

	.block-chain-addr-l {
		color: white;
		font-size: small;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		padding-right: 60rpx;
	}

	.block-chain-addr-r {}

	.pay-modal-pay-qrcode {
		margin: 20rpx auto 60rpx;
		width: 300rpx;
		height: 300rpx;

		img {
			width: 100%;
			height: 100%;
		}
	}

	.custom-tabs {
		padding-bottom: 20rpx;
	}

	.order-record {
		padding-left: 32rpx;
		padding-right: 32rpx;
		padding-bottom: 20rpx;
	}


	.order-record-content {
		background: #e7e7e7;
		padding-top: 10rpx;
		padding-bottom: 10rpx;
		border-radius: 20rpx;
		font-size: small;
	}

	.order-record-content-top {
		display: flex;
		justify-content: space-between;
		line-height: 2;
		padding-left: 20rpx;
		padding-right: 20rpx;
	}

	.order-record-content-top-l {
		color: #888;
	}

	.order-record-content-top-r {
		color: #18b566;
		font-weight: bold;
	}

	.cancel-state {
		color: #82848a;
	}

	.payment-state {
		color: #ff9900;
	}

	.payment-state-txt {
		padding-left: 4rpx;
	}

	.order-record-content-middle {
		display: flex;
		align-items: center;
		padding: 20rpx;

	}

	.order-record-content-middle-l {
		flex: 1;
	}

	.order-record-content-middle-r {
		flex: 2.5;
		align-self: flex-start;
	}

	.order-record-content-bottom {
		display: flex;
		justify-content: space-between;
		/* 左右对齐 */
		align-items: center;
		/* 垂直居中对齐 */
		padding: 10rpx 20rpx;
		/* 适当缩小左右和上下的填充 */
		line-height: 1.5;
		/* 行高稍微减少，使内容紧凑 */
	}



	.order-record-time {
		color: #888;
	}

	.order-record-amount {
		color: black;
	}

	.order-record-actions {
		display: flex;
		justify-content: flex-end;
		padding-left: 20rpx;
		padding-right: 20rpx;
		padding-top: 10rpx;
	}

	.cancel-btn {
		padding-right: 28rpx;
	}

	.collection-name {
		display: flex;
		justify-content: space-between;
	}

	.collection-name-l {
		font-weight: bold;
		margin: 4rpx;
	}

	.collection-name-2 {
		font-weight: bold;
		margin: 4rpx;
		margin-left: 12px;
	}

	.collection-name-r {}

	.order-list {
		padding: 10px;
	}

	.order-card {
		border: 1px solid #eee;
		border-radius: 10px;
		margin-bottom: 20px;
		padding: 10px;
		background-color: #fff;
	}

	.order-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.service-name {
		font-size: 16px;
		font-weight: bold;
	}

	.order-status {
		font-size: 14px;
	}

	.status-label {
		padding: 4px 8px;
		border-radius: 4px;
		color: #fff;
	}

	.status-label.waiting {
		background-color: #f0ad4e;
	}

	.status-label.assigned {
		background-color: #5bc0de;
	}

	.status-label.in-service {
		background-color: #5cb85c;
	}

	.status-label.awaiting-payment {
		background-color: #f0ad4e;
	}

	.status-label.awaiting-rating {
		background-color: #5bc0de;
	}

	.status-label.completed {
		background-color: #337ab7;
	}

	.status-label.canceled {
		background-color: #d9534f;
	}

	.order-info {
		margin-top: 10px;
		font-size: 14px;
	}

	.order-rating {
		margin-top: 10px;
	}

	.order-actions {
		margin-top: 10px;
		display: flex;
		justify-content: space-between;
	}

	u-button {
		margin-right: 10px;
	}

	.service-name {
		font-size: 16px;
		font-weight: bold;
		color: #333;
		padding: 10rpx 0;
	}

	.custom-order-modal-btn {
		margin-left: 5px;
		margin-right: 5px;
		padding: 3px 10px;
		/* 调整内边距使按钮更小 */
		border-radius: 15px;
		/* 圆角半径适当调整 */
		font-size: 12px;
		/* 字体略微变小 */
		font-weight: normal;
		/* 取消加粗 */
		box-shadow: none;
		/* 去掉阴影，按钮看起来更简洁 */
		border: 1px solid transparent;
		/* 默认边框透明 */
	}

	.custom-order-modal-btn-success {
		background-color: #4CAF50;
		/* 更加柔和的绿色 */
		color: white;
	}

	.custom-order-modal-btn-cancel {
		background-color: cornflowerblue;
		/* 柔和的红色 */
		color: white;
	}

	.custom-order-modal-btn:hover {
		opacity: 0.85;
		/* 鼠标悬停时稍微透明 */
	}

	.order-status {
		background-color: #e0f7fa;
		color: #007bff;
		padding: 5px 10px;
		border-radius: 12px;
		font-size: 12px;
		margin-left: 50px;
	}

	.container {
		padding: 20rpx;
	}

	/* 半透明遮罩层 */
	.popup-overlay {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: transparent;
		/* 半透明背景 */
		display: flex;
		justify-content: center;
		align-items: center;
		z-index: 1000 !important;
		/* 保证遮罩层和弹窗位于页面最上层 */
	}

	/* 弹窗内容 */
	.popup-content {
		background-color: #fff;
		padding: 40rpx;
		border-radius: 20rpx;
		text-align: center;
		width: 80%;
		z-index: 1001 !important;
		/* 保证弹窗内容显示在遮罩层之上 */
	}

	/* 标题和电话号码样式 */
	.popup-header {
		font-size: 32rpx;
		font-weight: bold;
		margin-bottom: 30rpx;
	}

	.phone-number {
		font-size: 36rpx;
		color: #ff4d4f;
		margin-bottom: 40rpx;
	}

	/* 订单信息样式 */
	.order-info {
		margin-bottom: 40rpx;
	}

	.order-item {
		display: flex;
		justify-content: space-between;
		font-size: 28rpx;
		margin-bottom: 10rpx;
	}

	/* 按钮样式 */
	.popup-buttons {
		display: flex;
		justify-content: space-between;
		margin-top: 20rpx;
	}

	.btn-cancel,
	.btn-confirm {
		width: 45%;
		padding: 20rpx;
		border-radius: 10rpx;
	}

	.btn-cancel {
		background-color: #f5f5f5;
		color: #333;
	}

	.btn-confirm {
		background-color: #007aff;
		color: #fff;
	}

	/* 施工上传样式 */
	.service-info {
		margin-bottom: 20rpx;
	}

	.service-item {
		margin-bottom: 10rpx;
		font-size: 30rpx;
	}

	.tab-container {
		display: flex;
		justify-content: space-between;
		margin: 20rpx 0;
	}

	.tab-item {
		width: 50%;
		text-align: center;
		padding: 20rpx;
		font-size: 30rpx;
		border: 1rpx solid #ccc;
	}

	.active {
		background-color: #007aff;
		color: #fff;
	}

	.upload-section {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 200rpx;
		border: 1rpx dashed #ccc;
		margin-bottom: 20rpx;
	}

	.upload-placeholder {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.upload-image {
		width: 100%;
		height: 100%;
	}

	.remark-section {
		margin-bottom: 20rpx;
	}

	.remark-input {
		width: 100%;
		height: 200rpx;
		border: 1rpx solid #ccc;
		padding: 20rpx;
		font-size: 30rpx;
	}

	.submit-btn {
		width: 100%;
		padding: 20rpx;
		background-color: #007aff;
		color: white;
		text-align: center;
		font-size: 32rpx;
		border-radius: 10rpx;
	}

	/* 施工上传结束 */
</style>